<?php

/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: Overview.php 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
class Sitepage_Form_Overview extends Engine_Form {
	
	public $_error = array ();
	
	public function init() {
		$this->setTitle ( 'Edit Page Overview' )->setDescription ( 'Overview enables you to create a rich profile for your Page using the editor below. Compose the overview and click "Save Overview" to save it.' )->setAttrib ( 'name', 'sitepages_overview' );
		$upload_url = "";
		$page_id = Zend_Controller_Front::getInstance ()->getRequest ()->getParam ( 'page_id', null );
		$sitepage = Engine_Api::_ ()->getItem ( 'sitepage_page', $page_id );
		$isManageAdmin = Engine_Api::_ ()->sitepage ()->isManageAdmin ( $sitepage, 'spcreate' );
		if (! empty ( $isManageAdmin )) {
			$upload_url = Zend_Controller_Front::getInstance ()->getRouter ()->assemble ( array ('action' => "upload-photo", 'page_id' => $page_id ), 'sitepage_dashboard', true );
		}
		// Overview
		$this->addElement ( 'TinyMce', 'overview', array ('label' => '', //             'required' => true,
		'allowEmpty' => false, 'attribs' => array ('rows' => 180, 'cols' => 350, 'style' => 'width:740px; max-width:740px;height:858px;' ), 'editorOptions' => array ('upload_url' => $upload_url, 'plugins' => 'preview,table,layer,style,xhtmlxtras,media,advhr,paste,fullscreen,searchreplace', 'theme_advanced_buttons1' => "preview,code,|,cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,anchor,charmap,image,media,advhr,|,hr,removeformat,cleanup,fullscreen,|,search,replace", 'theme_advanced_buttons2' => "bold,italic,underline,strikethrough,|,bullist,numlist,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,sub,sup,|,tablecontrols", 'theme_advanced_buttons3' => "formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,insertlayer,moveforward,movebackward,absolute,|,styleprops,attribs,|,cite,del,ins," ), 'filters' => array (new Engine_Filter_Censor (), new Engine_Filter_Html ( array ('AllowedTags' => "strong, b, em, i, u, strike, sub, sup, p, div, pre, address, h1, h2, h3, h4, h5, h6, span, ol, li, ul, a, img, embed, br, hr" ) ) ) ) );
		
		$this->addElement ( 'Button', 'save', array ('label' => 'Save Overview', 'type' => 'submit' ) );
	}

}
?>